home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pru_spikepits.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  94 lines

  1.  
  2. # Jones 3D Cog Script
  3. #
  4. # PRU_spikepits.cog    Blocks fall when touched, revealing spikepits.
  5. #
  6. # [GGJ]
  7. #
  8. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  9. #
  10. # ========================================================================================
  11.  
  12. symbols
  13.  
  14. message        entered
  15. message        timer
  16. message        startup
  17. message        arrived
  18.  
  19. sector        pit
  20. surface        hangLedge
  21.  
  22. thing        block
  23. thing        player        local
  24.  
  25. sound        sndDie=tem_temspikes_up_kill_c.wav        local
  26. #sound        crash=nub_stonedoor_start_c.wav            local
  27.  
  28. keyframe    impaled=in_die_buckle.key        local
  29.                                             
  30. template    tempRef=indy_sh_actor            local
  31.  
  32. int            once=0        local
  33. int            deadIndy    local
  34. int            victim        local
  35.  
  36. end
  37.  
  38. # ========================================================================================
  39.  
  40. code
  41. startup:
  42.     player = GetLocalPlayerThing();
  43.     ClearSurfaceFlags(hangLedge, 0x1000000);
  44.     return;
  45. # .................................................................................    
  46.  
  47. entered:
  48.     if (GetSenderRef() == pit)
  49.     {
  50.         DamageThing(player, 1000.0, 0x1, victim);
  51.         PlaySoundLocal(sndDie, 1.0, 0.0, 0x0, 0);
  52.         SetThingFlags(player, 0x80000);
  53.         deadIndy = CreateThing(tempRef, player);
  54.         CaptureThing(deadIndy);
  55.         ClearThingFlags(deadindy, 0x80000);
  56.         PlayKey(deadindy, impaled, 4, 0x14, 0);
  57.         return;
  58.     }          
  59.     
  60.     if (once < 1)
  61.     {
  62.         if ((GetMoveStatus(player) >= 3) && (GetMoveStatus(player) <= 5))
  63.         {
  64.             Print("Tim has a big new car");
  65.             MakeMeStop();
  66.             Sleep(0.01);
  67.             ClearActorFlags(player, 0x200000);
  68.         }
  69.         
  70.         Print("touched");
  71.         MoveToFrame(block, 1, 1);
  72.         SetTimer(0.75);
  73.     }        
  74.     return;
  75.  
  76. # .................................................................................
  77.  
  78. timer:
  79.     RotatePivot(block, 2, 0.25);
  80.     once = once + 1;
  81. #    PlaySoundThing(crash, block, 1.0, -1.0, -1.0, 0x0);
  82.     return;
  83.     
  84. arrived:
  85. if (GetSenderRef() == block)
  86. {
  87.     Sleep(1.0);
  88.     SetSurfaceFlags(hangLedge, 0x1000000);
  89.     Sleep(5.0);
  90.     SetCollideType(block, 0);
  91. }    
  92. return;
  93. end
  94.